import React from 'react';

export const withElementSerializer = (Component) => {
  const Serialize = () => {
    const name = Component.name || Component.displayName;
    return <React.Fragment name={name} />;
  };
  Serialize.displayName = `withElementSerializer(${Component.name || Component.displayName})`;
  return Serialize;
};